Dynomotion

Group: DynoMotion Message: 10365 From: Sam Marrocco Date: 10/22/2014
Subject: Interpreter unable to open file (error)
I've been trying to narrow down an error message that KMotionDotNet v433c is showing.

From time to time I will see a dialog box appear containing the text
"Unable to open input file
mypath/myfilename"

I did a text search through the KmotionDotNet source code and found this in the rs274ngc.cpp file.

My (pseudo) code currently does this:

Creates a line or collection of lines of GCode operations.
Writes those lines to a text file.
Waits for completion and closing of the file
Makes certain there is not already an Interpreter running.
Sends the filename to the Interpreter to be run.
Repeats.

At this point the error dialog appears--not always, but perhaps 1 out of 50 times. I am reasonably certain the the file is intact and ready for reading, but the error dialog is a bit vague. The C++ (not my strong point) and error dialog could use more specific error message(s). Is the file empty? Truly missing? Too long? Permission error? Open/by whom? Perhaps an error code needs to be returned by Interpret() instead of the abruptly halting dialog box. Perhaps a more detailed error message can be returned by the Interpreter.ErrorReceived event?

I may have mentioned this before....it would be helpful to be able to send a single line of gcode (or multiple lines) to an overload of Interpret(), bypassing the write to file->Interpret, repeat cycle.
--

sam marrocco | chief technical officer
ringside.cutters.picnic.moonlink

248 548 2500 w
248 910 3344 c

ringsidecreative.com

Group: DynoMotion Message: 10369 From: Tom Kerekes Date: 10/22/2014
Subject: Re: Interpreter unable to open file (error)
Hi Sam,

I can't think of why the file wouldn't be opened.

Here is a patch to display the error number (errno) set by the fopen call.  It is compatible with Test Version 4.33g


Source is included in the same directory.  Here is the code with the errno display if you just wish to chang it in your version:

    _setup.file_pointer = fopen(filename, "r");
   
    if (_setup.file_pointer==NULL)
    {
        char s[500];

        sprintf(s,"Unable to open input file %s\r\r code=%d",filename, errno);
        AfxMessageBox(s);
    }

Here is a link to the list of Microsoft errno Error codes:


HTH
Regards
TK



From: "Sam Marrocco SMarrocco@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Wednesday, October 22, 2014 1:29 PM
Subject: [DynoMotion] Interpreter unable to open file (error)

 
I've been trying to narrow down an error message that KMotionDotNet v433c is showing.

From time to time I will see a dialog box appear containing the text
"Unable to open input file
mypath/myfilename"

I did a text search through the KmotionDotNet source code and found this in the rs274ngc.cpp file.

My (pseudo) code currently does this:

Creates a line or collection of lines of GCode operations.
Writes those lines to a text file.
Waits for completion and closing of the file
Makes certain there is not already an Interpreter running.
Sends the filename to the Interpreter to be run.
Repeats.

At this point the error dialog appears--not always, but perhaps 1 out of 50 times. I am reasonably certain the the file is intact and ready for reading, but the error dialog is a bit vague. The C++ (not my strong point) and error dialog could use more specific error message(s). Is the file empty? Truly missing? Too long? Permission error? Open/by whom? Perhaps an error code needs to be returned by Interpret() instead of the abruptly halting dialog box. Perhaps a more detailed error message can be returned by the Interpreter.ErrorReceived event?

I may have mentioned this before....it would be helpful to be able to send a single line of gcode (or multiple lines) to an overload of Interpret(), bypassing the write to file->Interpret, repeat cycle.
--

sam marrocco | chief technical officer
ringside.cutters.picnic.moonlink

248 548 2500 w
248 910 3344 c

ringsidecreative.com



Group: DynoMotion Message: 10370 From: Sam Marrocco Date: 10/23/2014
Subject: Re: Interpreter unable to open file (error)

On 10/22/2014 10:35 PM, Tom Kerekes tk@... [DynoMotion] wrote:
 
Hi Sam,

I can't think of why the file wouldn't be opened.

Here is a patch to display the error number (errno) set by the fopen call.  It is compatible with Test Version 4.33g


Source is included in the same directory.  Here is the code with the errno display if you just wish to chang it in your version:

    _setup.file_pointer = fopen(filename, "r");
   
    if (_setup.file_pointer==NULL)
    {
        char s[500];

        sprintf(s,"Unable to open input file %s\r\r code=%d",filename, errno);
        AfxMessageBox(s);
    }

Here is a link to the list of Microsoft errno Error codes:





Thanks much....that will aid in troubleshooting the issue.

sam marrocco | chief technical officer
ringside.cutters.picnic.moonlink

248 548 2500 w
248 910 3344 c

ringsidecreative.com